<%@ page contentType="image/jpeg" import="java.net.*,java.io.*" %>
<%
	
	String path = request.getContextPath();
	String basePath = "http://niehonglei.appspot.com/";//request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	String urlPath = request.getParameter("url");
	String defaultUrl = basePath + "images/notfond.jpg";
	if(urlPath == null || "".equals(urlPath.trim())){
		urlPath = defaultUrl;
	}
	try{
		URL url = new URL(urlPath);
		InputStream is = url.openStream();
		byte[] buffer = new byte[2097152];//2M
		int num = is.read(buffer);
		is.close();
		byte[] imageByte = new byte[num];
		System.arraycopy(buffer,0,imageByte,0,num);
		out.clear();
		out = pageContext.pushBody();
		response.getOutputStream().write(imageByte);
	}catch(Exception e){
		URL url = new URL(defaultUrl);
		InputStream is = url.openStream();
		byte[] buffer = new byte[2097152];//2M
		int num = is.read(buffer);
		is.close();
		byte[] imageByte = new byte[num];
		System.arraycopy(buffer,0,imageByte,0,num);
		out.clear();
		out = pageContext.pushBody();
		response.getOutputStream().write(imageByte);
	}

%>